/* Copyright 2024. Huawei Technologies Co.,Ltd. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
        limitations under the License.
==============================================================================*/

#ifndef MXREC_CONFIG_H
#define MXREC_CONFIG_H

#include <string>

namespace MxRec {
    namespace RecEnvNames {
        const char *const APPLY_GRADIENTS_STRATEGY = "APPLY_GRADIENTS_STRATEGY";
        const char *const ACL_TIMEOUT = "AclTimeout";
        const char *const HD_CHANNEL_SIZE = "HD_CHANNEL_SIZE";
        const char *const KEY_PROCESS_THREAD_NUM = "KEY_PROCESS_THREAD_NUM";
        const char *const MAX_UNIQUE_THREAD_NUM = "MAX_UNIQUE_THREAD_NUM";
        const char *const FAST_UNIQUE = "FAST_UNIQUE";
        const char *const UPDATE_EMB_V2 = "UpdateEmb_V2";
        const char *const HOT_EMB_UPDATE_STEP = "HOT_EMB_UPDATE_STEP";
        const char *const GLOG_STDERR_THRESHOLD = "GLOG_stderrthreshold";
        const char *const USE_COMBINE_FAAE = "USE_COMBINE_FAAE";
        const char *const STAT_ON = "STAT_ON";
        const char *const RECORD_KEY_COUNT = "RECORD_KEY_COUNT";
    };

    namespace ApplyGradientsStrategyOptions {
        extern const std::string DIRECT_APPLY;
        extern const std::string SUM_SAME_ID_GRADIENTS_AND_APPLY;
    };

    struct GlobalEnv {
        static std::string applyGradientsStrategy;
        static int aclTimeout;
        static int hdChannelSize;
        static int keyProcessThreadNum;
        static int maxUniqueThreadNum;
        static bool fastUnique;
        static bool updateEmbV2;
        static int hotEmbUpdateStep;
        static int glogStderrthreshold;
        static bool useCombineFaae;
        static bool statOn;
        static bool recordKeyCount;
    };

    void ConfigGlobalEnv();
    void LogGlobalEnv();
}

#endif

